PREFIX="dist"

buildTag=`git describe --always`
buildTime=`date +%F@%T`
buildGo=`go version`

LDFLAGS="-X 'main.BuildTag=${buildTag}' -X 'main.BuildGo=${buildGo}' -X 'main.BuildTime=${buildTime}'"

global="./cmd/global.go"

go build -o="${PREFIX}/$1" -ldflags="${LDFLAGS}" ${global} ./cmd/$1.go
